-- raptor_form
-- create by shuzy
-- 主动技： 猛禽形态, 猛禽冈布奥专属技
-- raptor_form(slime_skill_id, force, round)

return{
    apply = function(source, target, skillId, round, para, extra)
        -- 专属技能等级
        local level;
        extra = extra or {};
        if extra["level"] then
            level = tonumber(extra["level"]);
        else
            local prop = PropM.combine(source, "gain_slime_skill", para[1]);
            level = PropM.apply(prop, 0);
        end

        local effectRound = -1;

        local lastRound = extra.lastRound;
        if type(lastRound) == "number" then
            effectRound = round + lastRound + 1;
        elseif para[4] > 0 then
            effectRound = round + para[4] + 1;
        end

        -- 威力
        local force = para[2];

        -- 作为战斗状态记录在玩家身上
        local condition = {
            ["value"] = force * level,
            ["level"] = level,
            ["shape_id"] = para[3],
            ["end_round"] = effectRound,
        }

        CombatStatusM.applyStatus(target, "raptor_form", condition);

        -- 返回作用目标
        return { target, };
    end,

    parse = function(desc)
        local arr = string.explode(desc, ",");
        return { tonumber(arr[1]), tonumber(arr[2]), tonumber(arr[3]), tonumber(arr[4] or -1),};
    end,

    -- 解析技能描述
    parseDesc = function(source, skillId, desc, para)
        -- 专属技能等级
        local prop = PropM.combine(source, "gain_slime_skill", para[1]);
        local level = PropM.apply(prop, 0);

        -- 技能效果
        local value = para[2] * level;
        desc = string.gsub(desc, "{value}", value);

        return desc;
    end,
};
